const oauth2orize = require('oauth2orize');
const authService = require('./authService');

// 授权代码类型的授予
exports.authorizationCode = oauth2orize.grant.code((client, redirectUri, user, ares, done) => {
    authService.grantAuthorizationCode(client, redirectUri, user, done);
});

// 授权码交换类型的授予
exports.accessToken = oauth2orize.exchange.code((client, code, redirectUri, done) => {
    authService.grantAccessToken(client, code, redirectUri, done);
});
